package com.example.concurrent;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.test3")
public class Test3 {

	public static void main(String[] args) throws Exception {
		FutureTask<Integer> task = new FutureTask<>(new Callable<Integer>() {

			@Override
			public Integer call() throws Exception {
				log.debug("running");
				Thread.sleep(2000);
				return 100;
			}
			
		});
		Thread t = new Thread(task,"t1");
		t.start();
		log.debug("{}",task.get());
	}
}
